package com.oazon.moco.lan.core.http;
import io.netty.channel.ChannelHandler;

import java.lang.reflect.Constructor;


public class HttpJsonHandleBuilder {

	public static <T extends ChannelHandler> T build(Class<T> handleClass,Object owner){
		
		try {
			Constructor<T> constructor = handleClass.getConstructor(owner.getClass());
			return constructor.newInstance(owner);
		} catch (Exception e) {
			e.printStackTrace();
			return null;
		} 
		
	}
}
